import request from '@/axios/request';
import url from '@/axios/url';
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}mesWarnReport/exportReport`
// 分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}mesWarnReport/reportPage`,
    method: 'get',
    params,
  });
}
// 新增
export function rowCreate(data = {}) {
  return request({
    url: `${mesUrl}mesWarnReport`,
    method: 'post',
    data,
  });
}
// 修改
export function rowUpdate(data = {}) {
  return request({
    url: `${mesUrl}mesWarnReport`,
    method: 'put',
    data,
  });
}
// 删除
export function rowDel(id) {
  return request({
    url: `${mesUrl}mesWarnReport/${id}`,
    method: 'put',
  });
}
// 详情
export function rowDetail(id) {
  return request({
    url: `${mesUrl}mesWarnReport/info/${id}`,
    method: 'get',
  });
}

// 导入用户
export function importData (data = {}) {
  return request({
    url: `${mesUrl}mesWarnReport/import`,
    method: 'POST',
    data,
    headers: {
      'Content-Type': 'multipart/form-data',
    }
  })
}
// 下载模板
export const downloadTemplateUrl = `${mesUrl}mesWarningReport/template`

// 查询OA状态：0 未推送，1已推送，2已处理列表
export function getWarningStatusList() {
  return request({
    url: `${adminUrl}dict/type/mes_warn_status`,
    method: 'get',
  });
}
// 查询异常级别
export function getWarningGradeList() {
  return request({
    url: `${adminUrl}dict/type/common_warn_grade`,
    method: 'get',
  });
}